javascript|js| Function | Scripting JavaScript can play a big role in web programming by writing some of the most common features into JavaScript libraries.
Save the following code as Common.js
Class Library Features:
1.Trim (str)--Remove the
In js, there are N data types. Here we will introduce the commonly used data type judgment methods, including Number ). Including integer, floating point, Boolean, String, array, null, Undefined, etc.
Let's take a look at one of my interview
Let's take a look at one of my interview questions.
Last week in the interview, the Examiner asked me how JS to determine the data type of a variable is an array, JS typeof can not distinguish between array and Object, this is a problem of JS.
1. Trim (STR) -- remove spaces on both sides of the string
2. xmlencode (STR) -- encode the string in XML format.
3. showlabel (STR, STR) -- mouse prompt function (display character, prompt character)
You can set the font, color, size,
Save the following code as Common. js
Class library function:
1. Trim (str) -- remove spaces on both sides of the string
2. XMLEncode (str) -- encode the string in XML format.
3. ShowLabel (str, str) -- mouse prompt function (display character,
Save the following code as Common.js
Class Library Features:
1.Trim (str)--Remove the spaces on either side of the string
2.XMLEncode (str)--XML encoding of strings
3.ShowLabel (STR,STR)--Mouse prompt function (display character, prompt
This article mainly introduces various javascript verification rules, involving javascript Detection Techniques for mobile phone numbers, email addresses, URLs, Chinese characters, and images, which are of reference value, for more information about
JavaScript can play a big role in web programming, writing some of the most common features into JavaScript libraries.
Save the following code as Common.js
Class Library Features:
1.Trim (str)--Remove the spaces on either side of the
CONST REG =/^ ([0-9]+) \. ([0-9]*) $/;//determine if it is a floating pointConst ISFLOAT =function(number) {returnreg.test (number);}//remove Decimal to IntegerConst FLOATTOINT =function(Head,tail) {//head:string tail:string //head and tail are
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.